<template>
    <a-input v-model:value="InputValue" v-bind="option"></a-input>
</template>
<script>
import { ref, watch, defineComponent } from "vue";

export default defineComponent({
    props: ["value", "option"],
    emits: ["update:value"],
    setup(props, { emit }) {
        const InputValue = ref();

        watch(
            () => props.value,
            (val) => {
                InputValue.value = val;
            },
            { immediate: true }
        );

        watch(InputValue, (val) => {
            emit("update:value", val);
        });

        return {
            InputValue,
        };
    },
    methods: {
        GetDefault() {
            return null;
        },
    },
});
</script>
<style lang="less" scoped></style>
